import SwiftUI

struct PhoneField: View {
    let countryCode: String
    @Binding var phone: String

    var body: some View {
        HStack(spacing: AppSpacing.m) {
            Text(countryCode)
                .foregroundStyle(.secondary)
                .frame(minWidth: 44, alignment: .leading)
            Rectangle()
                .foregroundStyle(.separator)
                .frame(width: 1, height: 20)
            TextField("手机号", text: $phone)
                .keyboardType(.numberPad)
                .textContentType(.telephoneNumber)
        }
        .padding(.horizontal, AppSpacing.l)
        .frame(height: 52)
        .overlay(
            RoundedRectangle(cornerRadius: AppRadius.m).strokeBorder(.separator)
        )
    }
}


